package com.lee9213.demo.tree;

/**
 * @author libo
 * @version 1.0
 * @date 2018/2/28 10:52
 */
public class TreeNode<T extends Comparable<T>> {

    private T value;
    private boolean isDelete;
    private TreeNode<T> leftNode;
    private TreeNode<T> rightNode;

    public TreeNode(T value) {
        this(value,false,null,null);
    }

    public TreeNode(T value, boolean isDelete, TreeNode<T> leftNode, TreeNode<T> rightNode) {
        this.value = value;
        this.isDelete = isDelete;
        this.leftNode = leftNode;
        this.rightNode = rightNode;
    }


    public T getValue() {
        return value;
    }

    public void setValue(T value) {
        this.value = value;
    }

    public boolean isDelete() {
        return isDelete;
    }

    public void setDelete(boolean delete) {
        isDelete = delete;
    }

    public TreeNode<T> getLeftNode() {
        return leftNode;
    }

    public void setLeftNode(TreeNode<T> leftNode) {
        this.leftNode = leftNode;
    }

    public TreeNode<T> getRightNode() {
        return rightNode;
    }

    public void setRightNode(TreeNode<T> rightNode) {
        this.rightNode = rightNode;
    }
}
